from base.Base import Base
from selenium.webdriver.common.by import By


class Page(Base):
    search_index = (By.ID,'input')

    def search_index_is(self):
        return self.find_element(self.search_index).is_displayed()

    def send_search_index(self):
        self.send_keys(self.search_index,'软件测试自动化')

    search_bot = (By.ID,'search-button')

    def click_search_bot(self):
        self.click(self.search_bot)

    one_text = (By.ID,'main')

    def get_one_text(self):
        return self.get_text(self.one_text)

    goto_tow = (By.XPATH,'/html/body/div[6]/div[3]/div[1]/a[1]')

    def click_goto_tow(self):
        self.click(self.goto_tow)

    tow_text = (By.ID,'main')

    def get_tow_text(self):
        return self.get_text(self.tow_text)